package parser;

import java.util.HashMap;

public class players {

	Long id;
	HashMap<String, Long> players_names;
	
	public players(){
		this.id = new Long(1);
		this.players_names = new HashMap<String, Long>();
	}
	
	public void put(String name, Long id){
		this.players_names.put(name, id);
	}
	
	public void increment_id(){
		this.id ++;
	}
	public boolean contains(String name){
		try{
			return this.players_names.containsKey(name);
		}catch (Exception ex){
			return false;
		}
	}
	public Long get(String name){
		return (Long) this.players_names.get(name);
	}
	public Long getnewid(){
		return this.id;
	}
	public String get_name(Long id){
		for(String name :this.players_names.keySet()){
			if(this.players_names.get(name).equals(id)){
				return name;
			}
		}
		return null;
	}
}
